<!DOCTYPE html>
<html  lang="zh_CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <title>上架详情列表</title>
    <th:block th:include="~{common/common::commonHead}"/>
</head>
<!-- /Head -->
<!-- Body -->
<body data-width="850" data-height="420">
<div class="widget-body grid-table">
    <div class="toolbar">
        <div class="fl-left">
            <!--<button data-click="del()" class="btn btn-danger shiny">下架商品</button>-->
        </div>
    </div>
    <div id="downPublish"></div>
    <form class="filter search-content form-horizontal" role="form">
        <div class="col-xs-6">
            <div class="form-group">
                <label class="col-xs-4 control-label"> 商品名称 </label>
                <div class="col-xs-8">
                    <div class="iconic-input right">
                        <input name="goodsName" type="text" class="form-control spinner"
                               placeholder="商品名称">
                    </div>
                </div>
            </div>
        </div>
        <div class="col-xs-6">
            <div class="form-group">
                <label class="col-xs-4 control-label"> 商品类型 </label>
                <div class="col-xs-8">
                    <select name="goodsType" class="form-control" data-url="goods/listGoodsType" data-value-field="id" data-text-field="typeName">
                        <option value="-1">全部</option>
                    </select>
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <button type="button" data-click="hideFilter()" class="btn btn-default pull-right">取消</button>
            <button type="button" data-click="submitFilter('downPublish')" class="btn btn-blue pull-right">确定</button>
        </div>
    </form>
</div><!-- end of panel -->
<!--</div>-->
<!--&lt;!&ndash; /Page Container &ndash;&gt;-->
<!--&lt;!&ndash; Main Container &ndash;&gt;-->

<!--</div>-->
</body>
<!--  /Body -->
</html>
<script>
    $(function () {
        $("#downPublish").gridTable({
            url: "goodsPublish/pagePublishDetail",
            columns: [
                {title: "供应商", field: "orgName"},
                {title: "监所", field: "prisonsName"},
                {title: "商品图片", field: "goodsImg", format: toImg},
                {title: "商品名称", field: "goodsName"},
                {title: "零售价", field: "goodsMarketPrice",dataType:"decimal"},
                {title: "供应价", field: "goodsSellPrice",dataType:"decimal"},
                {title: "结算价", field: "goodsSettlementPrice",dataType:"decimal"},
                {title: "商品状态", field: "goodsStatusStr"},
                {title: "单位", field: "goodsUnit"},
            ],
            idField: "id",
            onDoubleClickRow: "edit",
            editUrl:"goods/publishEdit.html",
            controls:{
                info:{show:false},
                del: {show: false}
            }
        });
    });
    function toImg(url) {
        return "<img src='"+url+"' width='80' height='80'>";
    }
</script>
